Skip to content

搜索被拒绝时明确降级并继续回答 - #506

Closed
taekchef wants to merge 4 commits into
mainfrom
codex/search-error-reporting
Closed

taekchef wants to merge 4 commits into
mainfrom
codex/search-error-reporting

Conversation

@taekchef

@taekchef taekchef commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

服务拒绝原生网页搜索工具时,Agent 现在会明确降级并继续回答:在尚未收到模型输出的前提下,仅对明确的“不支持搜索”HTTP 400 关闭本轮后续搜索并重试一次。同步更新模型的能力说明,并通过已有工具活动显示、记录搜索不可用;本地工具、会话历史、模型和推理档保持原配置,下一轮恢复正常搜索尝试。

移除传输层原先对几乎所有 HTTP 400 隐藏关闭搜索的重试,把恢复放到能同步提示词和用户状态的 Agent 循环。四类服务接口统一遵守请求中的搜索开关,避免本地课程工具把已关闭的搜索重新打开。无关请求错误、认证错误、限流、已经开始输出或降级后的再次失败保留错误;一般 HTTP 400 显示为请求被拒绝,不再误报临时服务故障。

验证:

  • 新增降级回归在修复前失败,修复后通过;覆盖本地工具继续执行、同轮保持关闭、下一轮恢复、用户提示与日志、八种搜索配置、仅一次降级及部分输出不重播。
  • swift test -j 4 --filter 'NativeProviderSearchFailureTests|NativeAgentReplayTests|NativeAgentRuntimeTests|NativeModelUsageTests|AgentReasoningEffortTests|AgentStreamingDisplayPumpTests':89 项通过。
  • .build/debug/WeiBeiSelfCheck:通过。
  • python3 script/check_ci_routing.py 和 git diff --check:通过。

边界:仅识别结构化错误中明确的不支持搜索措辞,其他错误保留真实失败。测试使用虚构凭据、隔离数据及本地响应,没有调用真实模型服务,未安装验证 App。此修复处理独立的搜索错误路径,不作为原足球事实错误已解决的证据。

@taekchef taekchef changed the title 搜索请求失败时保留错误,移除静默降级 保持搜索能力并准确报告模型请求错误 Sep 18, 2026
@taekchef taekchef changed the title 保持搜索能力并准确报告模型请求错误 搜索被拒绝时明确降级并继续回答 Sep 18, 2026

Copy link
Copy Markdown
Collaborator Author

这项改动已随 #512 接回 main。已核对本 PR 的完整组合补丁与 Codeberg #4 的 squash 提交 e19c0bc8 完全一致;后续错误处理改动也保留在主线中。

关闭重复待办,保留原分支和讨论,不再重复合并旧分支。

@taekchef taekchef closed this Sep 30, 2026
@taekchef
taekchef deleted the codex/search-error-reporting branch October 4, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant